%%{init: {'themeVariables': { 'fontSize': '12px'}}}%%
graph TD
    classDef path fill:#eee,stroke:#000,color:#000
    classDef plan fill:#fff,stroke-width:1px,color:#000
    classDef itemplan fill:#fff,stroke-width:2px,color:#000
    classDef unbatchedplan fill:#dff,stroke-width:1px,color:#000
    classDef sideeffectplan fill:#fcc,stroke-width:2px,color:#000
    classDef bucket fill:#f6f6f6,color:#000,stroke-width:2px,text-align:left

    subgraph "Buckets for queries/interfaces-single-table/single-topic-as-item"
    Bucket0("Bucket 0 (root)<br /><br />1: <br />ᐳ: 7, 9, 10, 24, 11<br />2: PgSelect[8]<br />3: PgSelectRows[13]<br />ᐳ: First[12], PgSelectSingle[14]"):::bucket
    Bucket1("Bucket 1 (nullableBoundary)<br />Deps: 14<br /><br />ROOT PgSelectSingleᐸsingle_table_itemsᐳ[14]"):::bucket
    end
    Bucket0 --> Bucket1

    %% plan dependencies
    PgSelect8[["PgSelect[8∈0] ➊<br />ᐸsingle_table_itemsᐳ<br />More deps:<br />- Constantᐸ10ᐳ[24]<br />- Constantᐸ'TOPIC'ᐳ[7]"]]:::plan
    Object11{{"Object[11∈0] ➊<br />ᐸ{pgSettings,withPgClient}ᐳ"}}:::plan
    Object11 --> PgSelect8
    Access9{{"Access[9∈0] ➊<br />ᐸ2.pgSettingsᐳ"}}:::plan
    Access10{{"Access[10∈0] ➊<br />ᐸ2.withPgClientᐳ"}}:::plan
    Access9 & Access10 --> Object11
    __Value2["__Value[2∈0] ➊<br />ᐸcontextᐳ"]:::plan
    __Value2 --> Access9
    __Value2 --> Access10
    First12{{"First[12∈0] ➊"}}:::plan
    PgSelectRows13[["PgSelectRows[13∈0] ➊"]]:::plan
    PgSelectRows13 --> First12
    PgSelect8 --> PgSelectRows13
    PgSelectSingle14{{"PgSelectSingle[14∈0] ➊<br />ᐸsingle_table_itemsᐳ"}}:::plan
    First12 --> PgSelectSingle14
    PgClassExpression15{{"PgClassExpression[15∈1] ➊<br />ᐸ__single_t...ems__.”id”ᐳ"}}:::plan
    PgSelectSingle14 --> PgClassExpression15
    PgClassExpression16{{"PgClassExpression[16∈1] ➊<br />ᐸ__single_t...s__.”type”ᐳ"}}:::plan
    PgClassExpression15 o--o PgClassExpression16
    PgClassExpression17{{"PgClassExpression[17∈1] ➊<br />ᐸ__single_t...__.”type2”ᐳ"}}:::plan
    PgClassExpression16 o--o PgClassExpression17
    PgClassExpression18{{"PgClassExpression[18∈1] ➊<br />ᐸ__single_t...”position”ᐳ"}}:::plan
    PgClassExpression17 o--o PgClassExpression18
    PgClassExpression19{{"PgClassExpression[19∈1] ➊<br />ᐸ__single_t...reated_at”ᐳ"}}:::plan
    PgClassExpression18 o--o PgClassExpression19
    PgClassExpression20{{"PgClassExpression[20∈1] ➊<br />ᐸ__single_t...pdated_at”ᐳ"}}:::plan
    PgClassExpression19 o--o PgClassExpression20
    PgClassExpression21{{"PgClassExpression[21∈1] ➊<br />ᐸ__single_t..._archived”ᐳ"}}:::plan
    PgClassExpression20 o--o PgClassExpression21
    PgClassExpression22{{"PgClassExpression[22∈1] ➊<br />ᐸ__single_t...chived_at”ᐳ"}}:::plan
    PgClassExpression21 o--o PgClassExpression22
    PgClassExpression23{{"PgClassExpression[23∈1] ➊<br />ᐸ__single_t...__.”title”ᐳ"}}:::plan
    PgClassExpression22 o--o PgClassExpression23

    %% define steps
    classDef bucket0 stroke:#696969
    class Bucket0,__Value2,PgSelect8,Access9,Access10,Object11,First12,PgSelectRows13,PgSelectSingle14 bucket0
    classDef bucket1 stroke:#00bfff
    class Bucket1,PgClassExpression15,PgClassExpression16,PgClassExpression17,PgClassExpression18,PgClassExpression19,PgClassExpression20,PgClassExpression21,PgClassExpression22,PgClassExpression23 bucket1

